import request from '@/utils/request'

export default{
    //条件查询分页
    pageList(pageNum,pageSize,searchObj){
        return request({
            url: `/goods/getGoodsPage/${pageNum}/${pageSize}`,
            method: 'post',
            //使用json格式传递 写法data：searchObj
            //使用j普通格式传递 写法params：searchObj
            data:searchObj
          })
    },

    deleteGoodsById(id){
        return request({
            url: `/goods/deleteGameById/${id}`,
            method: 'delete',
          })

    },

    saveGoods(goods){
        return request({
            url: `/goods/addGoods`,
            method: 'post',
            data:goods
          })
    },

    getGoodsById(id){
        return request({
            url: `/goods/getGoodsById/${id}`,
            method: 'get',
          })
    },

    updateGoods(goods){
        return request({
            url: `/goods/updateGoods`,
            method: 'post',
            data:goods
          })
    },

    batchRemove(idList) {
        return request({
          url: `/goods/removeBatch`,
          method: `delete`,
          data: idList
        })
    },
}